//
//  JYTTableViewCell.m
//  JYT_IOS
//
//  Created by nxa-tankeke on 16/12/29.
//  Copyright © 2016年 nxa-yuanguoxiang. All rights reserved.
//

#import "JYTTableViewCell.h"
#import "JYTMine.h"


@interface JYTTableViewCell()

@end


@implementation JYTTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initLaout];
    }
    return self;
}

- (void)initLaout{
    _titleImg = [[UIImageView alloc]initWithFrame:CGRectMake(15, 7 * CURRENT_SCREEN_HEIGHT / 667+5, 30 * CURRENT_SCREEN_HEIGHT / 667, 30 * CURRENT_SCREEN_HEIGHT / 667-5)];
    _titleImg.layer.masksToBounds = YES;
    _titleImg.layer.cornerRadius = 5;
    _titleImg.contentMode = UIViewContentModeScaleAspectFit;
    [self.contentView addSubview:_titleImg];
    
    _conLabel = [[UILabel alloc]initWithFrame:CGRectMake(60, 0, CURRENT_SCREEN_WIDTH - 60, 50 * CURRENT_SCREEN_HEIGHT / 667)];
    _conLabel.textColor = [UIColor blackColor];
    [self.contentView addSubview:_conLabel];
    
    _indcatorImg = [[UIImageView alloc]initWithFrame:CGRectMake(CURRENT_SCREEN_WIDTH - 30, 7 * CURRENT_SCREEN_HEIGHT / 667+5, 30 * CURRENT_SCREEN_HEIGHT / 667, 30 * CURRENT_SCREEN_HEIGHT / 667-10)];
    _indcatorImg.contentMode = UIViewContentModeScaleAspectFit;
    _indcatorImg.image = [UIImage imageNamed:@"arrow_r"];
    
    [self.contentView addSubview:_indcatorImg];
}

- (void)setMine:(JYTMine *)mine{
    _mine = mine;
    _titleImg.image = [UIImage imageNamed:mine.imageName];
   
    _conLabel.text = mine.content;
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
